<template>
  <div>
    <a-textarea
      :placeholder="placeholder"
      :default-value="defaultTextarea"
      :rows="rows"
      :maxLength="maxLength"
      @change="handleBrandChange"
    />
    <span class="textareaText">{{ defaultTextarea.length }}/500</span>
  </div>
</template>

<script>
export default {
  props: {
    rows: {
      type: Number
    },
    maxLength: {
      type: Number
    },
    placeholder: {
      type: String
    },
    defaultTextarea: {
      type: String
    }
  },
  data() {
    return {
      saleBrand: ""
    };
  },
  created() {},
  methods: {
    // 监听长度
    handleBrandChange(value) {
      this.$emit("changevalue", value.target.value);
    }
  }
};
</script>

<style scoped>
.textareaText {
  position: relative;
  float: right;
  top: -35px;
  right: 8px;
}
.ant-form-item-children textarea {
  resize: none;
}
</style>
